# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=certsync
pkgver=0.1.6
pkgrel=4
pkgdesc='Dump NTDS remotely without DRSUAPI: using golden certificate and UnPAC the hash.'
arch=('any')
groups=('blackarch' 'blackarch-exploitation' 'blackarch-windows')
url='https://github.com/zblurx/certsync'
license=('MIT')
depends=('python' 'python-tqdm' 'certipy')
makedepends=('python-build' 'python-pip')
source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('c4ad36901bec9de9a1601557d3db1fcd4c615a94c998a45bcf8168d71bb4dc87b7bf298a6a10530d45a86d5707f5b3fd621dfe4a7d17996a4077146695602891')

build() {
  cd "$pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $pkgname
}

